package com.chen.facemanager.service.impl;

import com.chen.facemanager.bean.Apk;
import com.chen.facemanager.bean.Info;
import com.chen.facemanager.dao.ApkDao;
import com.chen.facemanager.dao.InfoDao;
import com.chen.facemanager.service.ApkService;
import com.chen.facemanager.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApkServiceImpl implements ApkService {

    @Autowired
    private ApkDao apkDao;

    @Override
    public boolean save(String version, String url) {
        Apk apk = new Apk();
        apk.setVersion(version);
        apk.setUrl(url);
        if (apkDao.save(apk) != null){
            return true;
        }
        return false;
    }

    @Override
    public Apk getMaxVersionApk() {
        return apkDao.findVersion();
    }
}
